<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Buscar puntos por direccion</title>
    <?php require_once("../config.php"); 
		  require_once('../MAPS/google/header.php');
	?>
    
	<link href="css/gmapFoundDir.css" rel="stylesheet" type="text/css" />
    <!-- include clases MY -->
    <script src="../js/myClass/MyClass.js" type="text/javascript"></script> 
    <script src="../js/myClass/MyAjax.js" type="text/javascript"></script>        
    <script src="../js/myClass/MyBoundingHandler.js" type="text/javascript"></script>
    <!-- include GMapFoundDir.js -->
    <script src="js/GMapFoundDir.js" type="text/javascript"></script>
    <script src="js/MousePositionControl.js" type="text/javascript"></script>
    
    <!-- include json.js -->
    <script src="../js/json.js" type="text/javascript"></script>
</head>

<body onLoad="onLoadPage();" onResize="onResizePage();">
<table id="tablaMaqueta" align="center" border="1" bordercolor="#CCCCCC" width="100%">
	<tr>
    	<td><div id="Mapa"></div></td>
        <td id='tdMenu' width='300px'><div id="Menu"></div></td>
    </tr>
</table>
</body>
<script type="text/javascript">
	var tablaMaqueta = document.getElementById('tablaMaqueta');
	var mapDIV = document.getElementById('Mapa');
	var menuDIV = document.getElementById('Menu');
	var defaultLat = <?= DEFAULT_LATITUD ?>;
	var defaultLng = <?= DEFAULT_LONGITUD ?>;
	var defaultSearch = null;
	var gmapFoundDir = null;
	<? if (isset($_REQUEST['search'])) {?>
		defaultSearch = '<?= $_REQUEST['search']; ?>';
	<? } ?>
	var idToSave = null;
	<? if (isset($_REQUEST['id'])) {?>
		idToSave = '<?= $_REQUEST['id']; ?>';
	<? } ?>
	
	function onResizePage(){
		var docDim = myBoundingHandler.getDocumentDim();
		tablaMaqueta.style.height = docDim.h + 'px';
		mapDIV.style.height = docDim.h - 10 + 'px';
		menuDIV.style.height = docDim.h - 10 + 'px';
		if (gmapFoundDir!=null)
			gmapFoundDir.renderize();
	}
	
	function onLoadPage(){
		 onResizePage();
		 gmapFoundDir = new GMapFoundDir({
										 mapContainer: mapDIV,
	 									 menuContainer: menuDIV,
										 initialZoom: 5, 
	 									 initialLat: defaultLat, 
										 initialLng: defaultLng,
										 initialSearch: defaultSearch,
										 idToSaveDir: idToSave
									   });
	}
</script>
</html>
